<?php
class picture_front_controller extends system_controller_action {

	public static $keyword = '';
	private $lang = 'zh_cn';
	public function init($args = array()) {
		system_nav_language::getInstance()->setLanguage($this->_lang());
		self::$keyword = $this->language('请输入关键字') . ' ..';
		$this->view->navigateCategoryList = $this->getCache()->getNavigateCategoryList();
		$this->view->navigateKeywordList = $this->getCache()->getNavigateKeywordList();
		$this->view->cache = $this->getCache();
		$this->layout()->setLayout('layout');
		return true;
	}

	private $_cache = null;
	/**
	 * @return picture_front_cache
	 */
	protected function getCache() {
		if($this->_cache === null) {
			$this->_cache = new picture_front_cache();
		}
		return $this->_cache;
	}
	
	protected function language($index) {
		return system_nav_language::getInstance()->get($index);
	}

	protected function _lang() {
		return $this->lang;
	}
	/**
	 *
	 * @return system_nav_crumbs
	 */
	protected function _crumbs() {
		return $this->crumbs();
	}
		
	protected function _goRoute($name, array $urlOptions = array(), $reset = false) {
		$this->redirector()->gotoRouteAndExit($name, $urlOptions, $reset);
	}
	
	protected function _post($name = null, $default = null) {
		return $this->getRequest()->getPost($name, $default);
	}
	
	protected function _get($name = null, $default = null) {
		return $this->getRequest()->getQuery($name, $default);
	}
	
	protected function _param($name, $default = null) {
		return $this->getRequest()->getParam($name, $default);
	}
}
